<?php
namespace App\Http\Middleware;

use Closure;

class WebCompleteAuthInfo
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        $user = \Session::get('user');
        if ($user->is_profiled && $user->is_remitted) {
            return $next($request);
        } else {
            return redirect()->route('buz.auth.protocol');
        }
    }
}
